//
// Decompiled with: Decompiler.NET, Version=1.3.1.18439, Culture=neutral, PublicKeyToken=null, Version: 1.3.1.18439
// Decompilation Started at: 3/15/2009 10:34:26 PM
// Copyright 2003 - 2004, Jungle Creatures, Inc., All Rights Reserved. 
// Written by Jonathan Pierce, Email: support@junglecreatures.com
//

namespace PatientManagement

{
		
		#region Namespace Import Declarations
		
			using System.Collections;
			using System.ComponentModel;
			using System.Data.Common;
			using System.Data;
			using System.Data.SqlClient;
			using System.Drawing;
			using System;
			using System.Resources;
			using System.Windows.Forms;
			using Utility;
			
		#endregion
		
	public class frmUsedMedicine : Form
	
	{
		
		#region Fields
			private BindingManagerBase bmb;
			private Button btCapNhat;
			private Button btFirst;
			private Button btLast;
			private Button btSearch;
			private Button btXoa;
			private CheckBox chkAll;
			private Container components;
			private string con;
			private DataGrid dataGrid1;
			private Database_Com db;
			private DataSet dsStock;
			public int flag;
			private Label label1;
			private Label label3;
			private TextBox tbGoTo;
			private TextBox tbKeySearch;
		#endregion
		
		#region Constructors
		
			public frmUsedMedicine ()
			
			{
				this.flag = 1;
				this.components = ((System.ComponentModel.Container) null);
				this.db = new Database_Com ();
				this.InitializeComponent ();
				this.con = Connection.ConnectionString ();
				return;
			}
			
		#endregion
		
		#region Methods
		
			private void btFirst_Click (object sender, EventArgs e)
			
			{
				this.bmb.Position = 0;
				return;
			}
			
			private void btLast_Click (object sender, EventArgs e)
			
			{
				this.bmb.Position = (this.dsStock.Tables["vw_MedicineStock"].Rows.Count - 1);
				return;
			}
			
			private void btSearch_Click (object sender, EventArgs e)
			
			{
				string theString;
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				ArrayList theArrayList;
				string theString2;
				int i;
				SqlDataAdapter theSqlDataAdapter2;
				SqlDataAdapter theSqlDataAdapter3;
				int i2;
				string[] theStringArray;
				char[] theCharArray;
				int i3;
				string[] theStringArray2;
				string[] theStringArray3;
				theString = string.Empty;
				if (! this.chkAll.Checked)
				{
					goto L_0020;
				}
				this.frmUsedMedicine_Load (sender, e);
				goto L_05A8;
				
			L_0020:
				
				{
				}
				if (this.tbKeySearch.Text != "")
				{
					goto L_004F;
				}
				DialogResult theDialogResult = MessageBox.Show ("Vui l?ng nh?p t?n thu?c c?n t?m", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_05A8;
				
			L_004F:
				
				{
				}
				theSqlConnection = new SqlConnection (this.con);
				this.tbKeySearch.Text = this.tbKeySearch.Text.Trim ();
				theArrayList = new ArrayList ();
				theCharArray = new char[1];
				theCharArray[0] = '\u0020';
				theStringArray = this.tbKeySearch.Text.Split (theCharArray);
				i3 = 0;
				goto L_00B9;
				
			L_00A3:
				
				{
				}
				theString2 = theStringArray[i3];
				int i4 = theArrayList.Add (theString2);
				i3++;
				
			L_00B9:
				
				{
				}
				if (i3 < theStringArray.Length)
				{
					goto L_00A3;
				}
				i = 0;
				goto L_011B;
				
			L_00C6:
				
				{
				}
				if (i >= (theArrayList.Count - 1))
				{
					goto L_00F0;
				}
				theString = string.Concat (theString, " ", theArrayList[i].ToString (), " and");
				
			L_00F0:
				
				{
				}
				if (i != (theArrayList.Count - 1))
				{
					goto L_0115;
				}
				theString = string.Concat (theString, " ", theArrayList[i].ToString ());
				
			L_0115:
				
				{
				}
				i++;
				
			L_011B:
				
				{
				}
				if (i < theArrayList.Count)
				{
					goto L_00C6;
				}
				theStringArray2 = new string[5];
				theStringArray2[0] = "Select mimID,mimID as ID,mesMedicineName,mesQuantityInStock,mimProductionPerUnit"
				+ ",mesISN from  vw_MedicineStock Where CONTAINS(mesMedicineName,\'";
				theStringArray2[1] = theString;
				theStringArray2[2] = "\')  or mesMedicineName like \'%";
				theStringArray2[3] = this.tbKeySearch.Text;
				theStringArray2[4] = "%\'";
				theSqlDataAdapter = new SqlDataAdapter (string.Concat (theStringArray2), theSqlConnection);
				
			L_016A:
				try
				{
					this.dsStock.Clear ();
					int i5 = theSqlDataAdapter.Fill (this.dsStock, "vw_MedicineStock");
				}
				catch
				{
					
				L_018C:
					
					{
					}
					theString = string.Concat (this.tbKeySearch.Text.Substring (0, 1), "*");
					theStringArray3 = new string[5];
					theStringArray3[0] = "Select mimID,mimID as ID,mesMedicineName,mesQuantityInStock,mimProductionPerUnit"
					+ ",mesISN from  vw_MedicineStock Where CONTAINS(mesMedicineName,\'";
					theStringArray3[1] = theString;
					theStringArray3[2] = "\') or mesMedicineName like \'%";
					theStringArray3[3] = this.tbKeySearch.Text.Substring (0, 1);
					theStringArray3[4] = "%\'";
					theSqlDataAdapter2 = new SqlDataAdapter (string.Concat (theStringArray3), theSqlConnection);
					this.dsStock.Clear ();
					
				L_0202:
					try
					{
						int i6 = theSqlDataAdapter2.Fill (this.dsStock, "vw_MedicineStock");
					}
					catch
					{
						
					L_0217:
						
						{
						}
						theSqlDataAdapter3 = new SqlDataAdapter (string.Concat ("Select mimID,mimID as ID,mesMedicineName,mesQuantityInStock,mimProductionPerUnit"
						+ ",mesISN from  vw_MedicineStock Where mesMedicineName like \'%", this.tbKeySearch.Text, "%\'"), theSqlConnection);
						this.dsStock.Clear ();
						
					L_0245:
						try
						{
							int i7 = theSqlDataAdapter3.Fill (this.dsStock, "vw_MedicineStock");
						}
						catch
						{
							
						L_025A:
							
							{
							}
							DialogResult theDialogResult2 = MessageBox.Show ("T?n thu?c c? th? kh?ng t?n t?i trong c? s? d? li?u \n N?u b?n kh?ng ??nh c?, xin"
							+ " ??i 1 ph?t m?i nh?n n?t T?m \n N?u v?n kh?ng t?m th?y th? b?n n?n ch?n T?t C?.", "L?i nh?p", MessageBoxButtons.OK, MessageBoxIcon.Hand);
							goto L_05A8;
						}
						
					L_0273:
						
						{
						}
					}
					
				L_0275:
					
					{
					}
				}
				
			L_0277:
				
				{
				}
				theSqlDataAdapter.Dispose ();
				theSqlConnection.Close ();
				if ((this.dsStock != null) && ((this.dsStock.Tables.Count != 0) && (this.dsStock.Tables[0].Rows.Count != 0)))
				{
					goto L_02E7;
				}
				
			L_02BA:
				
				{
				}
				DialogResult theDialogResult3 = MessageBox.Show (string.Concat ("Kh?ng t?m th?y t?n thu?c : ", this.tbKeySearch.Text.ToString ()), "", MessageBoxButtons.OK, MessageBoxIcon.Hand);
				goto L_05A8;
				
			L_02E7:
				
				{
				}
				i2 = 0;
				goto L_0545;
				
			L_02EF:
				
				{
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mesISN"] = (i2 + 1);
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mimProductionPerUnit"].ToString () != "0")
				{
					goto L_038F;
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mimID"] = "vi?n";
				
			L_038F:
				
				{
				}
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mimProductionPerUnit"].ToString () != "1")
				{
					goto L_03FB;
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mimID"] = "?ng";
				
			L_03FB:
				
				{
				}
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mimProductionPerUnit"].ToString () != "2")
				{
					goto L_0467;
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mimID"] = "chai";
				
			L_0467:
				
				{
				}
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mimProductionPerUnit"].ToString () != "3")
				{
					goto L_04D3;
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mimID"] = "g?i";
				
			L_04D3:
				
				{
				}
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mimProductionPerUnit"].ToString () != "4")
				{
					goto L_053F;
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i2]["mimID"] = "tu?p";
				
			L_053F:
				
				{
				}
				i2++;
				
			L_0545:
				
				{
				}
				if (i2 < this.dsStock.Tables["vw_MedicineStock"].Rows.Count)
				{
					goto L_02EF;
				}
				this.dataGrid1.DataSource = this.dsStock;
				this.dataGrid1.SetDataBinding (this.dsStock, "vw_MedicineStock");
				this.dataGrid1.TableStyles.Clear ();
				this.loadDataGrid2 ();
				
			L_05A8:
				return;
			}
			
			private void btThoat_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btXoa_Click (object sender, EventArgs e)
			
			{
				DataSet theDataSet;
				string theString;
				string[] theStringArray;
				SqlDbType[] theSqlDbTypeArray;
				object[] theObjectArray;
				if (MessageBox.Show ("B?n c? mu?n h?y t?n thu?c n?y kh?ng ?", "Xo? Thu?c", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
				{
					goto L_00B5;
				}
				theDataSet = ((DataSet) this.dataGrid1.DataSource);
				theString = theDataSet.Tables[0].Rows[this.dataGrid1.CurrentRowIndex]["ID"].ToString ();
				SqlConnection theSqlConnection = this.db.CreateConnections ();
				theStringArray = new string[1];
				theStringArray[0] = "@mimID";
				theSqlDbTypeArray = new SqlDbType[1];
				theSqlDbTypeArray[0] = SqlDbType.NVarChar;
				theObjectArray = new object[1];
				theObjectArray[0] = theString;
				this.db.ExecuteStoredProc ("sp_Medicine_Delete", theStringArray, theSqlDbTypeArray, theObjectArray);
				DialogResult theDialogResult = MessageBox.Show ("?? x?a t?n thu?c trong kho", "Th?ng B?o", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				
			L_00B5:
				
				{
				}
				this.frmUsedMedicine_Load (sender, e);
				return;
			}
			
			private void chkAll_CheckedChanged (object sender, EventArgs e)
			
			{
				if (! this.chkAll.Checked)
				{
					goto L_001D;
				}
				this.tbKeySearch.Text = "";
				
			L_001D:
				return;
			}
			
			protected override void Dispose (bool disposing)
			
			{
				this.flag = 0;
				if (! disposing)
				{
					goto L_001D;
				}
				if (this.components == null)
				{
					goto L_001D;
				}
				this.components.Dispose ();
				
			L_001D:
				
				{
				}
				base.Dispose (disposing);
				return;
			}
			
			private void frmUsedMedicine_Load (object sender, EventArgs e)
			
			{
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				int i;
				theSqlConnection = new SqlConnection (this.con);
				theSqlDataAdapter = new SqlDataAdapter ("Select mimID,mimID as ID,mesMedicineName,mesQuantityInStock,mimProductionPerUnit"
				+ ",mesISN from vw_MedicineStock", theSqlConnection);
				this.dsStock = new DataSet ();
				int i2 = theSqlDataAdapter.Fill (this.dsStock, "vw_MedicineStock");
				if ((this.dsStock != null) && ((this.dsStock.Tables.Count != 0) && (this.dsStock.Tables[0].Rows.Count != 0)))
				{
					goto L_0071;
				}
				
			L_006C:
				
				{
				}
				goto L_0322;
				
			L_0071:
				
				{
				}
				i = 0;
				goto L_02C0;
				
			L_0078:
				
				{
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mesISN"] = (i + 1);
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mimProductionPerUnit"].ToString () != "0")
				{
					goto L_0114;
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mimID"] = "vi?n";
				
			L_0114:
				
				{
				}
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mimProductionPerUnit"].ToString () != "1")
				{
					goto L_017E;
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mimID"] = "?ng";
				
			L_017E:
				
				{
				}
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mimProductionPerUnit"].ToString () != "2")
				{
					goto L_01E8;
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mimID"] = "chai";
				
			L_01E8:
				
				{
				}
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mimProductionPerUnit"].ToString () != "3")
				{
					goto L_0252;
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mimID"] = "g?i";
				
			L_0252:
				
				{
				}
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mimProductionPerUnit"].ToString () != "4")
				{
					goto L_02BC;
				}
				this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mimID"] = "tu?p";
				
			L_02BC:
				
				{
				}
				i++;
				
			L_02C0:
				
				{
				}
				if (i < this.dsStock.Tables["vw_MedicineStock"].Rows.Count)
				{
					goto L_0078;
				}
				this.dataGrid1.DataSource = this.dsStock;
				this.dataGrid1.SetDataBinding (this.dsStock, "vw_MedicineStock");
				this.dataGrid1.TableStyles.Clear ();
				this.loadDataGrid ();
				
			L_0322:
				return;
			}
			
			private void InitializeComponent ()
			
			{
				ResourceManager theResourceManager;
				Control[] theControlArray;
				theResourceManager = new ResourceManager (typeof (frmUsedMedicine));
				this.dataGrid1 = new DataGrid ();
				this.label1 = new Label ();
				this.tbKeySearch = new TextBox ();
				this.label3 = new Label ();
				this.chkAll = new CheckBox ();
				this.tbGoTo = new TextBox ();
				this.btLast = new Button ();
				this.btFirst = new Button ();
				this.btCapNhat = new Button ();
				this.btSearch = new Button ();
				this.btXoa = new Button ();
				((ISupportInitialize) this.dataGrid1).BeginInit ();
				base.SuspendLayout ();
				this.dataGrid1.BackgroundColor = SystemColors.ActiveCaptionText;
				this.dataGrid1.CaptionVisible = false;
				this.dataGrid1.DataMember = "";
				this.dataGrid1.HeaderForeColor = SystemColors.ControlText;
				this.dataGrid1.Location = new Point (24, 80);
				this.dataGrid1.Name = "dataGrid1";
				this.dataGrid1.ReadOnly = true;
				this.dataGrid1.Size = new System.Drawing.Size (592, 280);
				this.dataGrid1.TabIndex = 46;
				this.label1.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label1.ForeColor = Color.MediumBlue;
				this.label1.Location = new Point (199, 13);
				this.label1.Name = "label1";
				this.label1.Size = new System.Drawing.Size (280, 23);
				this.label1.TabIndex = 47;
				this.label1.Text = "Danh S?ch Thu?c ?? S? D?ng";
				this.tbKeySearch.BorderStyle = BorderStyle.FixedSingle;
				this.tbKeySearch.Location = new Point (168, 48);
				this.tbKeySearch.Name = "tbKeySearch";
				this.tbKeySearch.Size = new System.Drawing.Size (184, 23);
				this.tbKeySearch.TabIndex = 49;
				this.tbKeySearch.Text = "";
				this.tbKeySearch.KeyPress += new KeyPressEventHandler (this.tbKeySearch_KeyPress);
				this.tbKeySearch.TextChanged += new EventHandler (this.tbKeySearch_TextChanged);
				this.label3.Location = new Point (80, 49);
				this.label3.Name = "label3";
				this.label3.Size = new System.Drawing.Size (88, 23);
				this.label3.TabIndex = 48;
				this.label3.Text = "T?n thu?c :";
				this.chkAll.Checked = true;
				this.chkAll.CheckState = CheckState.Checked;
				this.chkAll.Location = new Point (360, 48);
				this.chkAll.Name = "chkAll";
				this.chkAll.Size = new System.Drawing.Size (120, 24);
				this.chkAll.TabIndex = 51;
				this.chkAll.Text = "T?t c? thu?c";
				this.chkAll.CheckedChanged += new EventHandler (this.chkAll_CheckedChanged);
				this.tbGoTo.BorderStyle = BorderStyle.FixedSingle;
				this.tbGoTo.Location = new Point (56, 368);
				this.tbGoTo.Name = "tbGoTo";
				this.tbGoTo.Size = new System.Drawing.Size (64, 23);
				this.tbGoTo.TabIndex = 54;
				this.tbGoTo.Text = "";
				this.tbGoTo.TextChanged += new EventHandler (this.tbGoTo_TextChanged);
				this.btLast.FlatStyle = FlatStyle.Popup;
				this.btLast.Image = ((Image) ((Bitmap) theResourceManager.GetObject ("btLast.Image")));
				this.btLast.Location = new Point (128, 368);
				this.btLast.Name = "btLast";
				this.btLast.Size = new System.Drawing.Size (24, 23);
				this.btLast.TabIndex = 53;
				this.btLast.Click += new EventHandler (this.btLast_Click);
				this.btFirst.FlatStyle = FlatStyle.Popup;
				this.btFirst.Image = ((Image) ((Bitmap) theResourceManager.GetObject ("btFirst.Image")));
				this.btFirst.Location = new Point (24, 368);
				this.btFirst.Name = "btFirst";
				this.btFirst.Size = new System.Drawing.Size (24, 23);
				this.btFirst.TabIndex = 52;
				this.btFirst.Click += new EventHandler (this.btFirst_Click);
				this.btCapNhat.FlatStyle = FlatStyle.Popup;
				this.btCapNhat.Location = new Point (544, 368);
				this.btCapNhat.Name = "btCapNhat";
				this.btCapNhat.Size = new System.Drawing.Size (72, 23);
				this.btCapNhat.TabIndex = 55;
				this.btCapNhat.Text = "Tho?t";
				this.btCapNhat.Click += new EventHandler (this.btThoat_Click);
				this.btSearch.FlatStyle = FlatStyle.Popup;
				this.btSearch.Location = new Point (488, 48);
				this.btSearch.Name = "btSearch";
				this.btSearch.Size = new System.Drawing.Size (72, 23);
				this.btSearch.TabIndex = 56;
				this.btSearch.Text = "T?m";
				this.btSearch.Click += new EventHandler (this.btSearch_Click);
				this.btXoa.FlatStyle = FlatStyle.Popup;
				this.btXoa.Location = new Point (464, 368);
				this.btXoa.Name = "btXoa";
				this.btXoa.Size = new System.Drawing.Size (72, 23);
				this.btXoa.TabIndex = 57;
				this.btXoa.Text = "X?a";
				this.btXoa.Click += new EventHandler (this.btXoa_Click);
				this.AutoScaleBaseSize = new System.Drawing.Size (7, 16);
				base.ClientSize = new System.Drawing.Size (640, 397);
				theControlArray = new Control[11];
				theControlArray[0] = ((Control) this.btXoa);
				theControlArray[1] = ((Control) this.btSearch);
				theControlArray[2] = ((Control) this.btCapNhat);
				theControlArray[3] = ((Control) this.tbGoTo);
				theControlArray[4] = ((Control) this.btLast);
				theControlArray[5] = ((Control) this.btFirst);
				theControlArray[6] = ((Control) this.chkAll);
				theControlArray[7] = ((Control) this.tbKeySearch);
				theControlArray[8] = ((Control) this.label3);
				theControlArray[9] = ((Control) this.label1);
				theControlArray[10] = ((Control) this.dataGrid1);
				base.Controls.AddRange (theControlArray);
				this.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
				base.Icon = ((System.Drawing.Icon) theResourceManager.GetObject ("$this.Icon"));
				base.MaximizeBox = false;
				base.MinimizeBox = false;
				base.Name = "frmUsedMedicine";
				base.StartPosition = FormStartPosition.CenterScreen;
				this.Text = "Danh S?ch Thu?c";
				base.Load += new EventHandler (this.frmUsedMedicine_Load);
				((ISupportInitialize) this.dataGrid1).EndInit ();
				base.ResumeLayout (false);
				return;
			}
			
			public bool IsNumber (string text)
			
			{
				bool theBoolean;
				
			L_0000:
				try
				{
					long theLong = Convert.ToInt64 (text);
					theBoolean = true;
				}
				catch
				{
					
				L_000B:
					
					{
					}
					theBoolean = false;
				}
				
			L_0010:
				
				{
				}
				return theBoolean;
			}
			
			public void loadDataGrid ()
			
			{
				DataGridTableStyle theDataGridTableStyle;
				DataGridTextBoxColumn theDataGridTextBoxColumn;
				DataGridTextBoxColumn theDataGridTextBoxColumn2;
				DataGridTextBoxColumn theDataGridTextBoxColumn3;
				DataGridTextBoxColumn theDataGridTextBoxColumn4;
				DataGridTextBoxColumn theDataGridTextBoxColumn5;
				theDataGridTableStyle = new DataGridTableStyle ();
				theDataGridTableStyle.MappingName = "vw_MedicineStock";
				theDataGridTableStyle.AlternatingBackColor = Color.AliceBlue;
				theDataGridTableStyle.HeaderForeColor = Color.Maroon;
				theDataGridTableStyle.GridLineColor = Color.CornflowerBlue;
				theDataGridTextBoxColumn = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn.MappingName = "mesISN";
				theDataGridTextBoxColumn.HeaderText = " STT";
				theDataGridTextBoxColumn.Width = 50;
				theDataGridTextBoxColumn.Alignment = HorizontalAlignment.Center;
				int i = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn));
				theDataGridTextBoxColumn2 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn2.MappingName = "mesMedicineName";
				theDataGridTextBoxColumn2.HeaderText = "           T?n Thu?c";
				theDataGridTextBoxColumn2.Width = 220;
				theDataGridTextBoxColumn2.NullText = string.Empty;
				theDataGridTextBoxColumn2.Alignment = HorizontalAlignment.Center;
				int i2 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn2));
				theDataGridTextBoxColumn3 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn3.MappingName = "mesQuantityInStock";
				theDataGridTextBoxColumn3.HeaderText = "      S? L??ng T?n";
				theDataGridTextBoxColumn3.Width = 150;
				theDataGridTextBoxColumn3.NullText = string.Empty;
				theDataGridTextBoxColumn3.Alignment = HorizontalAlignment.Center;
				int i3 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn3));
				theDataGridTextBoxColumn4 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn4.MappingName = "mimID";
				theDataGridTextBoxColumn4.HeaderText = "     ??n V? T?nh";
				theDataGridTextBoxColumn4.Width = 135;
				theDataGridTextBoxColumn4.NullText = string.Empty;
				theDataGridTextBoxColumn4.Alignment = HorizontalAlignment.Center;
				int i4 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn4));
				theDataGridTextBoxColumn5 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn5.MappingName = "ID";
				theDataGridTextBoxColumn5.HeaderText = "";
				theDataGridTextBoxColumn5.Width = 0;
				theDataGridTextBoxColumn5.NullText = string.Empty;
				theDataGridTextBoxColumn5.Alignment = HorizontalAlignment.Center;
				int i5 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn5));
				theDataGridTableStyle.AllowSorting = false;
				int i6 = this.dataGrid1.TableStyles.Add (theDataGridTableStyle);
				this.bmb = this.BindingContext[this.dataGrid1.DataSource, this.dataGrid1.DataMember];
				return;
			}
			
			public void loadDataGrid2 ()
			
			{
				DataGridTableStyle theDataGridTableStyle;
				DataGridTextBoxColumn theDataGridTextBoxColumn;
				DataGridTextBoxColumn theDataGridTextBoxColumn2;
				DataGridTextBoxColumn theDataGridTextBoxColumn3;
				DataGridTextBoxColumn theDataGridTextBoxColumn4;
				DataGridTextBoxColumn theDataGridTextBoxColumn5;
				theDataGridTableStyle = new DataGridTableStyle ();
				theDataGridTableStyle.MappingName = "vw_MedicineStock";
				theDataGridTableStyle.AlternatingBackColor = Color.AliceBlue;
				theDataGridTableStyle.HeaderForeColor = Color.Maroon;
				theDataGridTableStyle.GridLineColor = Color.CornflowerBlue;
				theDataGridTextBoxColumn = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn.MappingName = "mesISN";
				theDataGridTextBoxColumn.HeaderText = " STT";
				theDataGridTextBoxColumn.Width = 50;
				theDataGridTextBoxColumn.Alignment = HorizontalAlignment.Center;
				int i = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn));
				theDataGridTextBoxColumn2 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn2.MappingName = "mesMedicineName";
				theDataGridTextBoxColumn2.HeaderText = "           T?n Thu?c";
				theDataGridTextBoxColumn2.Width = 220;
				theDataGridTextBoxColumn2.NullText = string.Empty;
				theDataGridTextBoxColumn2.Alignment = HorizontalAlignment.Center;
				int i2 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn2));
				theDataGridTextBoxColumn3 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn3.MappingName = "mesQuantityInStock";
				theDataGridTextBoxColumn3.HeaderText = "      S? L??ng T?n";
				theDataGridTextBoxColumn3.Width = 150;
				theDataGridTextBoxColumn3.NullText = string.Empty;
				theDataGridTextBoxColumn3.Alignment = HorizontalAlignment.Center;
				int i3 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn3));
				theDataGridTextBoxColumn4 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn4.MappingName = "mimID";
				theDataGridTextBoxColumn4.HeaderText = "     ??n V? T?nh";
				theDataGridTextBoxColumn4.Width = 133;
				theDataGridTextBoxColumn4.NullText = string.Empty;
				theDataGridTextBoxColumn4.Alignment = HorizontalAlignment.Center;
				int i4 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn4));
				theDataGridTextBoxColumn5 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn5.MappingName = "ID";
				theDataGridTextBoxColumn5.HeaderText = "";
				theDataGridTextBoxColumn5.Width = 0;
				theDataGridTextBoxColumn5.NullText = string.Empty;
				theDataGridTextBoxColumn5.Alignment = HorizontalAlignment.Center;
				int i5 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn5));
				theDataGridTableStyle.AllowSorting = false;
				int i6 = this.dataGrid1.TableStyles.Add (theDataGridTableStyle);
				this.bmb = this.BindingContext[this.dataGrid1.DataSource, this.dataGrid1.DataMember];
				return;
			}
			
			private void tbGoTo_TextChanged (object sender, EventArgs e)
			
			{
				int i;
				if (! this.IsNumber (this.tbGoTo.Text))
				{
					goto L_008C;
				}
				i = 0;
				goto L_006A;
				
			L_0017:
				
				{
				}
				if (this.dsStock.Tables["vw_MedicineStock"].Rows[i]["mesISN"].ToString () != this.tbGoTo.Text)
				{
					goto L_0066;
				}
				this.bmb.Position = i;
				goto L_008C;
				
			L_0066:
				
				{
				}
				i++;
				
			L_006A:
				
				{
				}
				if (i < this.dsStock.Tables["vw_MedicineStock"].Rows.Count)
				{
					goto L_0017;
				}
				
			L_008C:
				return;
			}
			
			private void tbKeySearch_KeyPress (object sender, KeyPressEventArgs e)
			
			{
				if (e.KeyChar != '\r')
				{
					goto L_0012;
				}
				this.btSearch_Click (sender, ((EventArgs) e));
				
			L_0012:
				return;
			}
			
			private void tbKeySearch_TextChanged (object sender, EventArgs e)
			
			{
				if (this.tbKeySearch.Text == "")
				{
					goto L_0025;
				}
				this.chkAll.Checked = false;
				goto L_0031;
				
			L_0025:
				
				{
				}
				this.chkAll.Checked = true;
				
			L_0031:
				return;
			}
			
		#endregion
	}
	
}

